package action.sbk_jjgl;

import java.util.ArrayList;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import services.sbk_jjgl.CzbtServices;
import com.util.Component;
import com.PublicSystem;
import com.util.Util;
import com.syslog.SysLogServices;
/**
 * 社会保障卡财政补贴登记
 * @author host
 *
 */
@Controller
@RequestMapping("Czbt.do")
public class CzbtAction {
	SysLogServices log = SysLogServices.getInstance();
	PublicSystem sys = PublicSystem.getInstance();
	CzbtServices cs = new CzbtServices();
	/**
	 * 更新表信息
	 * 
	 * @author duy
	 * @param request
	 * @param response
	 * @throws Exception
	 */
	@RequestMapping(params = "method=updateAZ15")
	public void updateAZ15(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String userid = Component.getSession("userid", request);
		String result = "";
		String json = request.getParameter("data");
		ArrayList rows = (ArrayList) Util.Decode(json);
		HashMap row = (HashMap) rows.get(0);
		String id = row.get("aaz001") != null ? row.get("aaz001").toString(): "";
		if (id.equals("")) {
			result = "";
		} else {
		cs.updateAZ15(row);	
		}
		HashMap obj = new HashMap();
		obj.put("domainid", "SBK");  //分系统号，见sys_log_bm
		obj.put("log_type", "T03");   //日志类别，见sys_log_bm
		obj.put("userid", userid); //操作人
		obj.put("rwh", Component.getSession("rwid", request));	      //任务号（菜单号），取Component.getSession("rwid", request),若特殊则为空为自定义
		obj.put("content", "制卡批次为：" + row.get("aaz001").toString() + "的成品卡验收登记");  //日志内容，自己组合拼装
		obj.put("czqd", "Q1");	      //操作渠道，见sys_log_bm
		obj.put("czrlb", "L01");      //操作人类别，见sys_log_bm
		obj.put("datain", json); //输入参数
		obj.put("dataout", "success");//输出参数
		log.sysLogMap(obj, request);
		Component.print(result, response);
	}

}
